package com.meilai.project.service.business.installOrder;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.meilai.project.dto.app.AppReplacePointDTO;
import com.meilai.project.dto.business.installOrder.*;
import com.meilai.project.entity.business.installOrder.WorkOrder;
import com.meilai.project.vo.business.installOrder.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @author ykb
 * @date 2022/3/17
 */
public interface WorkOrderService extends IService<WorkOrder> {

    public boolean replacePoint(AppReplacePointDTO dto);

    boolean batchReplacePoint(WebBatchReplacePointDTO dto);

    void submitRepairOrder(WorkerRepairPointDTO req);

    List<WorkerVO> listWorker(WorkerDTO workerDTO);

    List<WorkOrder> listByBillSaleId(Long billSaleId);

    Page<WorkOrderBillSaleVO> listPageBillSale(Integer page, Integer page_size, WorkOrderBillSaleDTO workOrderBillSaleDTO);

    Page<WorkOrderBuildingVO> listPageBuilding(Integer page, Integer page_size, WorkOrderBuidingDTO workOrderBuidingDTO);

    List<WorkOrderBuildingVO> listPageBuildingForCheckWorkOrder(WorkOrderBuidingDTO workOrderBuidingDTO);

    List<WorkOrderBuildingMatchWorkerVO> listBuildingMatchWorker(List<String> buildingIds);

    WorkOrderBuildingOfBillSaleVO listBuildingOfBillSale(Long bill_sale_id, Long choose_id, Long daterange_id);

    boolean saveWorkOrder(WorkOrderDTO dto);

    Page<WorkOrderVO> selectPageList(Integer page, Integer page_size, WorkOrderSearchDTO searchDTO);

    boolean delete(Long id);

    boolean handClosed(Long id);

    void genWorkOrderReport(String tenantName, WorkOrderReportInfoDTO data);

    WorkOrderDetailVO getWorkOrderDetailById(Long id);

    Map<Integer, Integer> listWorkOrderNumOfType();

    /**
     * 根据工单类型统计进度
     *
     * @param workOrderTypeId
     * @return
     */
    Map<String, Integer> getAllWorkOrderProgressByTypeId(Long workOrderTypeId);

    boolean updateWorkOrder(WorkOrderDTO dto);

    /**
     * 更新工单截止时间
     */
    boolean updateWorkOrderDeadLine(WorkOrderUpdateDeadlineDTO dto);

    List<WorkOrderProcessOfBuildingVO> listProcessOfBuilding(Long work_order_id, String name, Integer work_order_type_id);

    /**
     * 获取楼盘下的设备详情
     *
     * @param current_page
     * @param page_size
     * @param work_order_id
     * @param building_id
     * @param code
     * @param is_submit
     * @return
     */
    Page<SubmissionDetailVO> getWorkOrderSubmissionByBuildingId(Integer current_page, Integer page_size, Long work_order_id, Long building_id, String code, Boolean is_submit);


    void invalidByChooseIds(List<Long> chooseIdList);

    void hangUpByChooseIds(List<Long> chooseIdList);

    void cancelHangUpByChooseIds(List<Long> chooseIdList);

    /**
     * 根据工单ID创建图片包
     *
     * @param work_order_id
     */
    void createImgPackage(Long work_order_id);

    void exportWorkOrderPointDetail(Long id, String name, HttpServletResponse response);

    void exportLockPointDetail(Long lockId, String name, HttpServletResponse response);

    Boolean assignWorkers(WorkOrderAssignWorkersDTO workOrderAssignWorkersDTO);
}
